From 9083658c43f6d36ebae4e30d95225d79ede4bc30 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 18 Nov 2017 02:09:03 +0100 Subject: [PATCH] CIE: Simplify code Exploit the fact that fy is not needed to calculate the a and b components. This is consistent with the other monochrome conversions. --- extensions/CIE.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/extensions/CIE.c b/extensions/CIE.c index 658fd2a..d5ed9ee 100644 --- a/extensions/CIE.c +++ b/extensions/CIE.c @@ -713,10 +713,7 @@ rgbaf_to_Lf (const Babl *conversion,float *src, float b = src[2]; float yr = m_1_0 * r + m_1_1 * g + m_1_2 * b; - - float fy = yr > LAB_EPSILON ? _cbrtf (yr) : (LAB_KAPPA * yr + 16.0f) / 116.0f; - - float L = 116.0f * fy - 16.0f; + float L = yr > LAB_EPSILON ? 116.0f * _cbrtf (yr) - 16 : LAB_KAPPA * yr; dst[0] = L; -- 2.30.2